from litellm import completion
from dotenv import load_dotenv
import os

load_dotenv()
messages = [{"role": "user", "content": "1+1等于多少？"}]
response = completion(model=os.getenv("MODEL"),
                      base_url=os.getenv("BASE_URL"),
                      api_key=os.getenv("API_KEY"),
                      messages=messages)
print(response)
# 输出：
# {
#   "content": "1+1等于2。",
#   "role": "assistant"
# }
